package com.sss.hloster0103;

public class Student {
	private String stuName = " ";
	private int stuAge = -1;
	private int stuSex = -1;
	private int stuGrade = -1;
	// 使用初始化块初始化
	{
		System.out.println("使用初始化块初始化！！");
		this.stuName = "雷静";
		this.stuAge = 22;
		this.stuSex = 2;
		this.stuGrade=4;
	}
	//午餐构造方法
	public Student() {
		System.out.println("使用无参构造函数初始化");
	}
	//构造方法，用户初始化对象的成员变量
	public Student(String name,int age,int sex,int grade) {
		System.out.println("使用有参构造的函数初始化");
		this.stuName=name;
		this.stuAge=age;
		this.stuSex=sex;
		this.stuGrade=grade;
	}
	//省略了Student类中的其他方法
	public String getStuName() {
		return stuName;
	}
	public void setStuName(String stuName) {
		this.stuName = stuName;
	}
	public int getStuAge() {
		return stuAge;
	}
	public void setStuAge(int stuAge) {
		this.stuAge = stuAge;
	}
	public int getStuSex() {
		return stuSex;
	}
	public void setStuSex(int stuSex) {
		this.stuSex = stuSex;
	}
	public int getStuGrade() {
		return stuGrade;
	}
	public void setStuGrade(int stuGrade) {
		this.stuGrade = stuGrade;
	}
	
}
